<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="utils.DBConnector"%>
<%@page import="utils.Printer"%>
<%@ page language="java" contentType="text/html; charset=windows-1255"
    pageEncoding="windows-1255"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255" />
<link href="style.css" rel="stylesheet" type="text/css" />
<% String user = request.getSession(false).getAttribute("username").toString(); %>
<title><%= user + "'s Hompage" %></title>
</head>
<%	
if (request.getSession(false) == null || request.getSession(false).getAttribute("username") == null){
	response.sendError(HttpServletResponse.SC_FORBIDDEN, "Please login first");
	return;
}
		
if (!request.getSession(false).getAttribute("type").equals("admin")) {
	response.sendError(HttpServletResponse.SC_FORBIDDEN, "Only Admin can view this page");
	return;			
}
%>
		
<body onload = "setPage('home')">
<%@ include file="/WEB-INF/private/body_wrapper_header.html" %>

<% String username =  (String)request.getSession(false).getAttribute("username");%>
<h2>Welcome <%= username %> </h2>
<h4>There are <%= manager.SessionManager.getNumSessions() %> users currently logged in the site</h4>

<%@ include file="/WEB-INF/private/body_wrapper_footer.html" %>
</body>
</html>